package com.hd.homework0412.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("product")
public class Product {
    @TableField("product_id")
    private Integer productId;
    @TableField("product_name")
    private String productName;
    @TableField("category_id")
    private Integer categoryId;
    @TableField("root_category_id")
    private Integer rootCategoryId;
    @TableField("sold_num")
    private Integer soldNum;
    @TableField("product_status")
    private Integer productStatus;
    @TableField("content")
    private String content;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private Date updateTime;
    @TableField(exist = false)
    private List<ProductImg> imgs;
}
